package com.bbtree.springmvc.rabbitmq;


import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MessageProductorService  {
	
	    @Autowired
	    private AmqpTemplate amqpTemplate;


	    public void sendDataToQueue(String queueKey, Object object) {
	        try {
	            amqpTemplate.convertAndSend(queueKey, object);
	        } catch (Exception e) {
	            e.printStackTrace();
	        }

	    }

}
